<?php
define('ACCESS_KEY9296',true);
require('./include/init.php');


$cart = new CartModel();

if(@$_GET['m']=='add'){
$cake_id=$_POST['cake_id'];
$cake_num=$_POST['num'];
$cart->addToCart($cake_id,$cake_num);
exit(json_encode($cart->showCart(2)));
}
else if(@$_GET['m']=='delete'){
$cake_id=$_POST['cake_id'];
$cake_num=$_POST['num'];
$cart->delete($cake_id,$cake_num);
exit(json_encode($cart->showCart(2)));
}